<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="dealerList.title"/></title>
    <meta name="menu" content="DealerMenu"/>
</head>

<c:if test="{'$'}{not empty searchError}">
    <div class="alert alert-danger alert-dismissable">
        <a href="#" data-dismiss="alert" class="close">&times;</a>
        <c:out value="{'$'}{searchError}"/>
    </div>
</c:if>
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        <fmt:message key="dealerList.heading"/>
        <small><p><fmt:message key="dealerList.message"/></p></small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i><fmt:message key="dealerList.heading"/></a></li>
        <li class="active"> <fmt:message key="dealerList.heading"/></li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <%@ include file="/common/messages.jsp" %>
            <div class="box">
                <div class="box-header">
                    <%--<h3 class="box-title"> <fmt:message key="dealerList.heading"/></h3>--%>

                </div><!-- /.box-header -->
                <div class="box-body table-responsive">
                    <%--<div id="actions" class="btn-group">
                        <a href='<c:url value="/dealerform"/>' class="btn btn-primary">
                            <i class="fa fa-plus"></i> <fmt:message key="button.add"/></a>
                        <a href='<c:url value="/home"/>' class="btn btn-default"><i class="fa fa-check"></i> <fmt:message key="button.done"/></a>
                    </div>--%>
                    <display:table name="dealerList" class="table table-condensed table-striped table-hover" requestURI="" id="dealerList" export="true" pagesize="25">
                        <display:column property="name" sortable="true" href="dealerform?from=list" media="html"
                                        paramId="dealerId" paramProperty="id" titleKey="dealer.name"/>
                        <display:column property="id" media="csv excel xml pdf" titleKey="dealer.id"/>
                        <display:column property="bond.name" sortable="true" titleKey="dealer.bondCompany"/>
                        <display:column property="adminUser.username" sortable="true" titleKey="admin.username"/>
                        <display:column property="adminUser.name" sortable="true" titleKey="dealer.contactPerson"/>
                        <display:column property="adminUser.phoneNumber" sortable="true" titleKey="dealer.contactNumber"/>
                        <display:column property="adminUser.email" sortable="true" titleKey="user.email"/>
                        <display:column property="province" sortable="true" titleKey="dealer.province"/>
                        <display:column property="city" sortable="true" titleKey="dealer.city"/>
                        <display:column property="mailAddress" sortable="true" titleKey="dealer.mailAddress"/>
                        <display:column property="slaveProvider.name" sortable="true" titleKey="dealer.slaveProvider"/>
                        <display:column property="masterProvider.name" sortable="true" titleKey="dealer.masterProvider"/>
                        <display:column property="premiumRate" sortable="false" titleKey="dealer.premiumRate"/>
                        <display:column sortable="true" titleKey="dealer.riskRank"><fmt:message key="RISK_RANK_${dealerList.riskRank}"/></display:column>
                        <display:column sortable="true" titleKey="dealer.allowNoMortgaged">
                            <input type="checkbox" disabled="disabled" <c:if test="${dealerList.allowNoMortgaged}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column sortable="true" titleKey="dealer.insuranceChannel">
                            <input type="checkbox" disabled="disabled" <c:if test="${dealerList.insuranceChannel}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column sortable="true" titleKey="dealer.plateRestricted">
                            <input type="checkbox" disabled="disabled" <c:if test="${dealerList.plateRestricted}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column sortable="true" titleKey="dealer.requestEnabled">
                            <input type="checkbox" disabled="disabled" <c:if test="${dealerList.requestEnabled}">checked="checked"</c:if>/>
                        </display:column>
                        <display:column sortable="true" titleKey="dealer.loanEnabled">
                            <input type="checkbox" disabled="disabled" <c:if test="${dealerList.loanEnabled}">checked="checked"</c:if>/>
                        </display:column>

                        <display:setProperty name="paging.banner.item_name"><fmt:message key="dealerList.dealer"/></display:setProperty>
                        <display:setProperty name="paging.banner.items_name"><fmt:message key="dealerList.dealers"/></display:setProperty>

                        <display:setProperty name="export.excel.filename"><fmt:message key="dealerList.title"/>.xls</display:setProperty>
                        <display:setProperty name="export.csv.filename"><fmt:message key="dealerList.title"/>.csv</display:setProperty>
                        <display:setProperty name="export.pdf.filename"><fmt:message key="dealerList.title"/>.pdf</display:setProperty>
                    </display:table>

                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div>
    </div>
</section><!-- /.content -->



